<?php

require_once dirname(__FILE__) . '/../_data/LzSqlTest.php';

$sql    = new LzTestClass('LzSqlTest');

try { $sql->parseCmp(NULL); }
catch (LzBadUsage $e) { LzTests::ln('NULL failed'); }

try { $sql->parseCmp(false); }
catch (LzBadUsage $e) { LzTests::ln('false failed'); }

try { $sql->parseCmp(''); }
catch (LzBadUsage $e) { LzTests::ln('"" failed'); }

LzTests::ln(
        $sql->parseCmp(true),
        $sql->parseCmp(0),
        $sql->parseCmp(5),
        $sql->parseCmp(0.5),
        $sql->parseCmp(array('a', 'b')),
        $sql->parseCmp('foo'),
        $sql->parseCmp(LzSql::raw(':foo > bar', array('foo' => 'foo')))
    );
var_dump($sql->data());

?>
---EXPECT---
NULL failed
false failed
"" failed
|1| = :BIND0
|0| = :BIND1
|5| = :BIND2
|0.5| = :BIND3
(|a| = :BIND4 AND |b| = :BIND5)
|foo| = :BIND6
:foo > bar
array(8) {
  ["BIND0"]=>
  NULL
  ["BIND1"]=>
  NULL
  ["BIND2"]=>
  NULL
  ["BIND3"]=>
  NULL
  ["BIND4"]=>
  NULL
  ["BIND5"]=>
  NULL
  ["BIND6"]=>
  NULL
  ["foo"]=>
  string(3) "foo"
}

